# 请将下面的json对象保存到文件,并再次读取，后将spc字段值改成"喷火"
# https://blog.csdn.net/strive_for_future/article/details/107564274?utm_term=python%E4%BF%9D%E5%AD%98json%E6%96%87%E4%BB%B6%E5%88%B0%E6%9C%AC%E5%9C%B0&utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~sobaiduweb~default-6-107564274&spm=3001.4430
import json

My_json = {"name": "汤姆", "city": "火城", "age": 6, "spc": None}

# 生成json文件
with open('./huangcui.json', 'w', encoding='utf-8') as f:
    json.dump(My_json, f, ensure_ascii=False)


# 读取json文件
with open('./huangcui.json', 'r', encoding='utf-8') as f:
    data = json.load(f)
    data["spc"] = "喷火"
    print(data)